package com.jd.controller;

import com.jd.pojo.Room;
import com.jd.service.RoomService;
import com.jd.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/room")
public class RoomController {
    @Autowired
    private RoomService roomService;
    @GetMapping("findRoom")
    public SysResult findRoomList(){
        List<Room> rooms = roomService.FindRoomList();
        return SysResult.success(rooms);
    }
}
